<?php
/**
 * Formulaire d'upload. Ce formulaire requière une option 'upload_path' pour
 * fonctionner.
 * 
 * @package   form
 * @author    jacksay14
 *
 */
class JckBrowserUploadForm extends BaseForm {
  public function configure()
  {
    // Chargement des helpers de localisation
    sfApplicationConfiguration::getActive()->loadHelpers('I18N');
    
    $this->setWidgets(array(
      'file' => new sfWidgetFormInputFile()
    ));
    
    $this->widgetSchema->setLabels(array(
      'file' => __('Upload a new file',null,'jckbrowser')
    ));
    
    
    $this->setValidators(array(
      'file'  => new sfValidatorFile(array(
        'path' => $this->getOption('upload_path')
      )
    )));
    
    $this->widgetSchema->setNameFormat('uploader[%s]');
  }
}